from mcpi.minecraft import Minecraft, mcpy
from mcpi.vec3 import Vec3
from util.coordinates import mc, RelativeCoordinates

def oak_street_light(rc):
    rc.setBlocks(*(0, 0, -1), *(0, 2, -1), "橡木栅栏")
    rc.setBlock(*(0, 3, -1), "去皮橡木")
    rc.setBlock(*(0, 4, -1), "火把")


def stone_well(rc):
    rc.setBlocks(*(0, 0, -1), *(0, 2, -1), "橡木栅栏")

def field(rc):
    rc.setBlocks(*(0, 0, -1), *(0, 2, -1), "橡木栅栏")


@mcpy
def buildstructure(playerName="xiaole", type=1):
    """
    造建筑物
    """
    structure_list = {
        1: oak_street_light, # 1 橡木路灯（火把需要自己插)
        2: stone_well, # 2 水井
        3: field, # 农田, 要自己锄地
    }
    player = mc.getPlayer(playerName)
    rc = RelativeCoordinates(player, Vec3(0, 0, 0))
    if structure_list[type]:
        nop()






@mcpy
def bs(*params):
    """
    buildstructure 的缩写命令
    """
    buildstructure(*params)


# 单独运行的话，执行下面测试代码
if __name__ == "__main__":
    buildstructure("xiaole", 3, 3, 3, "煤炭块")
